package com.bkgy.modular.tbdsjplancheckpdiC621.controller;

import com.alibaba.fastjson.JSONObject;
import com.bkgy.modular.tbdsjplancheckpdiC621.service.PlanCheckPdi621Service;
import com.bkgy.sys.common.entity.ResultData;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/planCheckPdi621")
public class PlanCheckPdi621Controller {
    @Resource
    private PlanCheckPdi621Service planCheckPdi621Service;

    @PostMapping("/findDataByPage")
    public ResultData findDataByPage(@RequestBody JSONObject json){
        return planCheckPdi621Service.findDataByPage(json);
    }

    @PostMapping("/findLineDataByVolumeNo")
    public ResultData findLineDataByVolumeNo(@RequestBody JSONObject json){
        return planCheckPdi621Service.findLineDataByVolumeNo(json);
    }

    /**
     * 根据卷号查询模板数据
     * @return
     */
    @CrossOrigin
    @RequestMapping(value = "/findTemplateData",method = RequestMethod.POST)
    public ResultData findTemplateData(@RequestBody JSONObject json){
        return planCheckPdi621Service.findTemplateData(json);
    }

    /**
     * 2130根据卷号查询模板数据
     */
    @CrossOrigin
    @RequestMapping(value = "/find2130MongoData",method = RequestMethod.POST)
    public ResultData findMongoDbData(@RequestBody JSONObject json) {
        return planCheckPdi621Service.findMongoDbData(json);
    }

    /**
     * 列表导出功能
     * @param jsonObject
     * @param response
     */
    @PostMapping("/exportXlsx")
    public void export(@RequestBody JSONObject jsonObject, HttpServletResponse response) {
        planCheckPdi621Service.export(jsonObject,response);
    }
}
